import request from '@/utils/request'
import { useTokenStore } from '@/stores/token';
//文章分类列表查询
export const articleCategoryListService=()=>{
    //从pinia中获取token
    //const tokenStore=useTokenStore()
    //在pinia中定义的响应式对象都不需要.value可以直接使用
    //return request.get('/category',{headers:{'Authorization':tokenStore.token}})
    return request.get('/category')
}
//提供添加文章分类接口
export const addCategoryService=(categoryModel)=>{
    return request.post('/category/add',categoryModel)
}
//提供更新文章分类接口
export const updateCategoryService=(categoryModel)=>{
    return request.put('/category/update',categoryModel)
}
//提供删除文章分类接口
export const deleteCategoryService=(id)=>{
    return request.delete('/category/delete?id='+id)
}
//提供查询文章列表的接口
export const articleListService=(params)=>{
    return request.get('/Article',{params:params})
}
//提供添加文章的接口
export const addArticleService=(articleDate)=>{
    return request.post('/Article',articleDate)
}
//提供删除文章接口
export const deleteArticleService=(id)=>{
    return request.delete('/Article?id='+id)
}
//提供修改文章接口
export const updateArticleService=(articleDate)=>{
    return request.put('/Article',articleDate)
}